package com.ctms.system.controller;

import com.ctms.system.domain.CourseStuAmountDO;
import com.ctms.system.service.CourseStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@RequestMapping("/courseStuAmount")
@Controller
public class CourseStuAmountController {

    @Autowired
    CourseStudentService courseStudentService;

    @GetMapping("")
    public String amount(){
        return "sys/courseStudent/courseStuAmount";
    }


    @PostMapping("/amount")
    @ResponseBody
    public List<CourseStuAmountDO> list(){
        List<CourseStuAmountDO> courseStuAmountDOS = courseStudentService.countAmount();
        return courseStuAmountDOS;
    }
}
